let persons = [
  {
    name: 'wj',
    age: 18,
    books: [
      {
        title: '数学',
        time: 8
      },
      {
        title: '语文',
        time: 10
      },
      {
        title: '英语',
        time: 12
      }
    ]
  },
  {
    name: 'mz',
    age: 19,
    books: [
      {
        title: '数学',
        time: 3
      },
      {
        title: '语文',
        time: 4
      },
      {
        title: '英语',
        time: 5
      }
    ]
  }
]

let 符合的人 = persons.filter((person) => {
  let 符合的书 = person.books.filter((book) => {
    if (book.time >= 10) {
      return true
    } else {
      return false
    }
  })
  console.log(符合的书)

  if (符合的书.length > 0) {
    return true
  } else {
    return false
  }
})

console.log(符合的人)

let ps = persons.filter(p => p.books.filter(b => b.time >= 10).length > 0)

console.log(ps)
